<template>
  <div class="result">
    <div>
      <a-icon
        theme="filled"
        :class="[isSuccess ? 'success' : 'error' ,'icon']"
        :type="isSuccess ? 'check-circle' : 'close-circle'"
      />
    </div>
    <div class="title" v-if="title">{{title}}</div>
    <div class="desc" v-if="email">恭喜您注册成功，我们已经向您的{{email}}邮箱发送了一封激活邮件，请点击邮件中的链接完成账户激活！</div>
    <div class="content" v-if="description">
      <slot>{{description}}</slot>
    </div>
    <div class="action">
      <slot name="action"></slot>
    </div>
    <div class="content1" v-if="!isSuccess">
      <div style="margin-bottom: 10px;">失败原因:</div>
      <div class="reason_div">
        <a-icon type="close-circle" class="reason_icon" theme="filled" />
        {{reason}}
      </div>
    </div>
  </div>
</template>

<script>
import AIcon from "ant-design-vue/es/icon";
export default {
  name: "Result",
  components: { AIcon },
  props: ["isSuccess", "title", "email", "description", "reason"],
  methods: {}
};
</script>

<style lang="less" scoped>
.result {
  text-align: center;
  width: 72%;
  margin: 0 auto;
  .icon {
    font-size: 72px;
    line-height: 72px;
    margin-bottom: 24px;
  }
  .success {
    color: #29a576;
  }
  .error {
    color: #f04134;
  }
  .title {
    font-size: 24px;
    color: rgba(0, 0, 0, 0.75);
    font-weight: 500;
    line-height: 32px;
    margin-bottom: 32px;
  }
  .desc {
    font-size: 14px;
    line-height: 22px;
    color: rgba(0, 0, 0, 0.45);
    margin-bottom: 24px;
  }
  .content {
    /* background: #fafafa; */
    width: 60%;
    margin: 0 auto;
    padding: 5px 40px;
    border-radius: 2px;
    text-align: center;
  }
  .content1 {
    background: #fafafa;
    padding: 20px 40px;
    width: 50%;
    margin: 15px auto;
    border-radius: 2px;
    text-align: left;
  }
  .action {
    margin-top: 32px;
  }
  .reason_div {
    display: flex;
    align-items: center;
  }
  .reason_icon {
    font-size: 18px;
    color: #f04134;
    margin-right: 10px;
  }
}
</style>
